package top.lshaci.learning.alibaba.cloud.seata.order.api;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lshaci.learning.alibaba.cloud.seata.order.service.BusinessService;

/**
 * OrderController
 *
 * @author lshaci
 * @since 1.0.0
 */
@RestController
@AllArgsConstructor
@RequestMapping("/business")
public class BusinessController {

    private final BusinessService businessService;

    /**
     * 采购
     */
    @GetMapping("/purchase/{userId}/{commodityCode}/{orderCount}")
    public void purchase(@PathVariable String userId, @PathVariable String commodityCode, @PathVariable int orderCount) {
        businessService.purchase(userId, commodityCode, orderCount);
    }
}
